class Furniture:
    def __init__(self,name,area):
        self.name=name
        self.area=area
class House:
    def __init__(self,address,area):
        self.address=address
        self.area=area
        self.remainder_area=area
        self.furniture=[]
    def __str__(self):
        return f'房子位置：{self.address},占地面积：{self.area},'\
               f'剩余面积：{self.remainder_area},家具有：{self.furniture}'

    def add_furnishing(self,item):
        if self.remainder_area>=item.area:
            self.remainder_area-=item.area
            self.furniture.append(item.name)
        else:
            print('家具太大装不下了')


if __name__=='__main__':
    my_house=House('学院路7号',158)

    bed=Furniture('床',20)
    ball = Furniture('足球场',1200)
    my_house.add_furnishing(bed)
    my_house.add_furnishing(ball)

    print(my_house)
